Skip to content

[51.0.x] Restore lenient base64 decoding for Fernet keys and tokens (#16116) - #16118

Merged
alex merged 3 commits into
51.0.xfrom
claude/adoring-heisenberg-iebmcq
Dec 2, 2026
Merged

alex merged 3 commits into
51.0.xfrom
claude/adoring-heisenberg-iebmcq

Conversation

@reaperhulk

Copy link
Copy Markdown
Member

Backport of #16116 to the 51.0.x branch. Fixes #16110.

51.0.0's Rust Fernet implementation rejected keys and tokens whose base64 encoding has non-zero trailing bits or contains ASCII whitespace, both of which 50.x accepted. This allows them again.

The cherry-pick applied cleanly. This PR also adds a 51.0.1 changelog section with an entry for the regression fix.


Generated by Claude Code

reaperhulk and others added 3 commits December 2, 2026 15:36
* Restore lenient base64 decoding for Fernet keys and tokens

The Rust port of Fernet in 51.0.0 rejected keys and tokens with non-zero
trailing bits or embedded whitespace, which Python's
base64.urlsafe_b64decode previously accepted. Allow both again.

Fixes #16110

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ajQWxTgQg9sjt6Qw5StZH

* Drop changelog entry; it will land with the 51.0.x backport

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ajQWxTgQg9sjt6Qw5StZH

---------

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 40da4b8)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ajQWxTgQg9sjt6Qw5StZH
…aude/adoring-heisenberg-iebmcq

# Conflicts:
#	CHANGELOG.rst
@alex
alex merged commit 44002be into 51.0.x Dec 2, 2026
69 checks passed
@alex
alex deleted the claude/adoring-heisenberg-iebmcq branch December 2, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants